@(path: String, categoryList: List[Category])

@import utils.BoardUtil
<style>
  .black a {
    color:#000000!important;
  }
  .fly-column {
    height: 60px!important;
    line-height: 60px!important;
  }
  .fly-column ul li {
    position: relative;
    display: inline-block;
    height: 60px!important;
  }
  .layui-nav-more {
    content: '';
    width: 0;
    height: 0;
    border-style: solid dashed dashed;
    border-color: #000 transparent transparent!important;
    overflow: hidden;
    cursor: pointer;
    transition: all .2s;
    -webkit-transition: all .2s;
    position: absolute;
    top: 50%;
    right: 3px;
    margin-top: -3px;
    border-width: 6px;
    border-top-color: rgba(0,0,0,.7)!important;
  }
  .layui-nav-mored {
    margin-top: -9px;
    border-style: dashed dashed solid;
    border-color: transparent transparent #000!important;
  }
  .layui-bg-white {
    background-color: #FFFFFF!important
  }
  .layadmin-homepage-pad-img {
    box-shadow: 0 0 0 4px rgba(0,0,0,.1);
    border-radius: 50%;
  }
  .layadmin-homepage-font {
    font-weight: 600;
    color: #2b425b;
    font-size: 1.2em;
  }
  h4 {
    display: block;
    margin-block-start: 0.6em;
    margin-block-end: 0.5em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    font-weight: bold;
  }

  .layui-bg-white .layui-this:after {
    display:none!important;
  }

</style>

<div class="fly-panel fly-column">
    <div class="layui-container">
        <ul class="layui-nav layui-bg-white" lay-filter="" style="padding:0;">
            @BoardUtil.getAllLevelPaths(path).map{ levelPath =>
            <li class="layui-nav-item black">
                <a href="javascript:;">@{if(levelPath == "/") "所有版块" else categoryList.find(_.path == levelPath).map(_.name).getOrElse("-")}</a>
                @defining(BoardUtil.getChildren(levelPath, categoryList)){ children =>
                @if(children.nonEmpty){
                <dl class="layui-nav-child"> <!-- 二级菜单 -->
                    @children.sortBy(_.index).map{ c =>
                    <dd><a href="/boards?path=@c.path">@c.name</a></dd>
                    }
                </dl>
                }
                }
            </li>
            }
        </ul>

        <div class="fly-column-right layui-hide-xs">
            <span class="fly-search"><i class="layui-icon"></i></span>
            @if(nav == "index" || nav == "article"){
            <a href='/article/add' class="layui-btn">我要分享</a>
            }else{
            <a href='/qa/add' class="layui-btn">我要提问</a>
            }
        </div>
        <div class="layui-hide-sm layui-show-xs-block" style="margin-top: -10px; padding-bottom: 10px; text-align: center;">
            @if(nav == "index" || nav == "article"){
            <a href='/article/add' class="layui-btn">我要分享</a>
            }else{
            <a href='/qa/add' class="layui-btn">我要提问</a>
            }
        </div>
    </div>
</div>